# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=libksane4
_pkgname=libksane
pkgver=15.08.3
pkgrel=4
pkgdesc="An image scanning library"
url="https://projects.kde.org/projects/kde/kdegraphics/libs/libksane"
arch=(i686 x86_64)
license=(GPL LGPL FDL)
depends=(kdelibs sane)
makedepends=(cmake automoc4)
replaces=('libksane<15.11')
conflicts=('libksane<15.11')
source=("http://download.kde.org/stable/applications/$pkgver/src/$_pkgname-$pkgver.tar.xz")
sha1sums=('2707d84bdcd0ec568ff47066012c3086b07477cc')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$_pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DKDE4_BUILD_TESTS=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install

# Fix conflicts with libksane>=16.04
  rm -r "$pkgdir"/usr/share
}
